Improve data type parsing and formatting #317
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a C module to delegate the parsing of data types by
col_type_is()
to the Postgres coreparseTypeString()
function, which is the canonical type parser. This ensure that no matter the aliasing or typemod specified for a data type, we end up with exactly the same spelling as the core uses, ensuring more accurate comparisons. This was necessitated by the change in 1e1d745 that added support for type aliases but broke complicated typmods such assecond(0)
ininterval second(0)
. Resolves #315.Document the two new functions,
parse_type()
andformat_type_string()
and remove the documentation forpg_typeof()
, which hasn't shipped with pgTAP in several years, since it has been in the Postgres core since 8.3.Also, fix the name of the v1.3.9 upgrade file.